
SRCS=$(wildcard *.cpp)
BIN_SRCS=$(shell grep "BOOST_TEST" -l *.cpp) 

BINS=$(patsubst %.cpp,%.bin,$(BIN_SRCS))

DEP_LIBS=  ../framework/libframework.a  ../lua_loader/liblua_loader.a


CC=clang++
INC= -I. -I../framework  -I../lua_loader

CFLAGS += -g -DDEBUG
LDFLAGS +=  -lboost_unit_test_framework -llua

all: $(BINS) 

$(BINS): %.bin : %.cpp $(DEP_LIBS) 
	$(CC) -o $@ $^ $(INC) $(CFLAGS) $(LDFLAGS) 

clean:
	rm -f $(BINS) 

%.d : %.cpp
	$(CC) $(CFLAGS)  -MT $(subst .cpp,.o,$<) -MM $(INC)  $< >$@
%.o : %.cpp
	$(CC) $(CFLAGS) $(INC) -c  $< 


